--
-- Author: shunguo.chen
-- Date: 2018-05-10 11:04:13
--
-- ChessResultEfcView
--

local Armature = app:getClass("Armature")

local fileName = string.getModeName(...)
local ClassRef = class(fileName, app.mvc.ViewBase)

function ClassRef:initRoot()

end

function ClassRef:init()
	self:setBackGroundColorOpacity(0)

end

-- isWin 胜利
function ClassRef:refresh(isWin)
	local conf = isWin and Res.BattleWinEffect or Res.BattleLoseEffect
	local params = {
		path = conf.dir,
		armatureName = conf.name
	}
	local armature = Armature.create(params)
	armature:setPosition(display.cx, display.cy)
	self:addChild(armature)
	armature:play(conf.name, 1, function()
			executeFunc(self._onCloseView, self)
		end)
end

return ClassRef
